package com.neusoft.bizcore.mom.bean;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Getter;
import lombok.Setter;

/**
 * 消息队列传递的实体类
 *
 * @author naxiang
 * @param <T>
 */
@Getter
@Setter
public class MessageBean implements Serializable {

    private static final long serialVersionUID = 6432150265257632278L;

    // 传递的实体信息JSON
    private String message;
    // 发送给队列的时间
    private Date sendDate;

    @JsonCreator
    public MessageBean(@JsonProperty("message") final String message, @JsonProperty("sendDate") final Date sendDate) {
        this.message = message;
        this.sendDate = sendDate;
    }

    @Override
    public String toString() {
        return "MessageBean [message=" + this.message + ", sendDate=" + this.sendDate + "]";
    }
}
